package com.sztz.batch;

import cn.hutool.core.exceptions.ExceptionUtil;
import com.sztz.entity.FirmUser;
import com.sztz.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.core.ItemProcessListener;
import org.springframework.lang.Nullable;

/**
 * 数据处理监听器
 * @author yzy
 * @date 2022/8/30 17:50
 */
@Slf4j
public class MyProcessListener implements ItemProcessListener<User,FirmUser> {
    @Override
    public void beforeProcess(User item) {}

    @Override
    public void afterProcess(User item, @Nullable FirmUser result) {
    }

    @Override
    public void onProcessError(User item, Exception e) {
        log.error("onProcessError = {}", ExceptionUtil.stacktraceToString(e));
    }
}
